package com.itstyle.seckill.topic.desinger.design_xw.state;

/**
 * @Auther: liuwenxiang
 * @Date: 2019/9/18 23:23
 * @Description:
 */
public class ScoreContext {

    private AbstractState state;

    ScoreContext()
    {
        state=new LowState(this);//默认状态，随着add执行(分数的改变，状态也跟着改变)
    }

    public void setState(AbstractState state)
    {
        this.state=state;
    }
    public AbstractState getState()
    {
        return state;
    }

    public void add(int score)
    {
        state.addScore(score);
    }

}
